{extend name='Public:content'/}
{block name='title'}广告管理{/block}
{block name='content'}
<div class="row animated fadeIn">
    <div class="row">
        <div class="col-md-8">
            <div class="panel panel-default tabs">
                <ul class="nav nav-tabs" role="tablist">
                    <li class="active"><a href="#tab-first" role="tab" data-toggle="tab">广告位置
                        <button class="btn btn-success btn-rounded btn-sm">{$num}</button>
                    </a></li>
                    <li><a href="#tab-second" role="tab" data-toggle="tab">广告位置添加</a></li>
                </ul>
                <div class="panel-body tab-content">
                    <div class="tab-pane active" id="tab-first">
                        <div class="alert alert-info" role="alert">
                            <button type="button" class="close" data-dismiss="alert"><span
                                    aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                            <strong>Heads up!</strong> This alert needs your attention, but it's not super important.
                        </div>
                        <table id="table_demo" class="table datatable table-hover">
                            <thead>
                            <tr>
                                <th>广告位置</th>
                                <th>宽度</th>
                                <th>高度</th>
                                <th>广告位描述</th>
                                <th>创建时间</th>
                                <th></th>
                            </tr>
                            </thead>
                            <tbody>
                            {volist name="list" id="vo"}
                            <tr class="del_tr">
                                <td>{$vo.name}</td>
                                <td>{$vo.width}</td>
                                <td>{$vo.height}</td>
                                <td>{$vo.describe}</td>
                                <td>{$vo.create_time|date='Y-m-d H:i:s',###}</td>
                                <td>
                                    <a title="【编辑】" data-url="{:url('admin/Ad/edit',array('id'=>$vo.id))}" onclick="edit_row(this)" class="btn btn-default btn-rounded btn-sm">
                                        <span class="fa fa-pencil"></span>
                                    </a>
                                    <button onClick="delete_row(this);" data-url="{:url('admin/Ad/del',array('id'=>$vo.id))}" class="btn btn-danger btn-rounded btn-sm">
                                        <span class="fa fa-times"></span>
                                    </button>
                                </td>
                            </tr>
                            {/volist}
                            </tbody>
                        </table>
                    </div>
                    <div class="tab-pane" id="tab-second">
                        <form id="add_form" method="post" action="{:url('admin/Ad/add')}" class="form-horizontal">
                            <div class="panel-body">
                                <div class="row">
                                    <div class="col-md-6">
                                        <div class="form-group">
                                            <label class="col-md-3 control-label">广告位置</label>
                                            <div class="col-md-9">
                                                <input name="name" type="text" class="form-control"/>
                                                <span class="help-block">格式:fa fa-users</span>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-md-3 control-label">宽度</label>
                                            <div class="col-md-9">
                                                <input name="width" type="text" class="form-control"/>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-md-3 control-label">高度</label>
                                            <div class="col-md-9">
                                                <input name="height" type="text" class="form-control"/>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-md-3 control-label">描述</label>
                                            <div class="col-md-9">
                                                <input name="describe" type="text" class="form-control"/>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="panel-footer">
                                <button class="btn btn-info pull-right">保存修改
                                    <span class="fa fa-floppy-o fa-right"></span>
                                </button>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script type="text/javascript">
    $('.table-form').dataTable({
        "order": [],
    });
</script>
{/block}